<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ include file="/taglibs.jsp"%>
<html>
<head>
<title>IT管理后台</title>
<%@	include file="/js/js.js"%>
<style type="text/css">
.menu0 a {
	margin: 0;
	padding: 0;
	width: 180px;
	display: block;
}

.menu0 a span {
	line-height: 20px;
	float: left;
	cursor: hand;
}

.menu0 a img {
	float: left;
}
</style>
<script>
$(function(){
	$('#mm-save,#mm-cancel').linkbutton();
	mm = $('#mm-window').window({
		modal: true,
		maximizable:false,
		minimizable:false,
		collapsible:false,
		closed:true
	});
	mmform = mm.find('form');
	
	$("#jmm").validatebox({
		required:true,
		missingMessage:"旧密码不能为空！"
	});
	
	$("#mm").validatebox({
		required:true,
		missingMessage:"新密码不能为空！"
	});
});
	function addTab(title, url){
	    if ($('#tt').tabs('exists', title)){
	        $('#tt').tabs('select', title);
	    } else {
	        var content = '<iframe scrolling="auto" frameborder="0" src="'+url+'" style="width:100%;height:100%;"></iframe>';
	        $('#tt').tabs('add',{
	            title:title,
	            content:content,
	            closable:true,
	            fit:true,
	            border:false
	        });
	    }
	}
	
	function tc(){
		$.messager.confirm('友情提醒','<br/><b>您确定要退出系统吗？</b>',function(b){
		    if(b)window.location.replace("/logout");
		});
	}
	
	function openMm(){  
		mm.window('open');  
		mmform.form('clear');  
	}  
	function editMm(){
		mmform.form('submit', {  
			  url:mmform.action,
			  onSubmit:function(){
			        return $(this).form('validate');
			    },
			  success:function(data){
			          if (data=='success'){  
			        	  	$.messager.alert('信息提示','修改密码成功！','right');  
			                mm.window('close');  
			            } else if(data=='wrong'){
			            	$.messager.alert('信息提示','旧密码输入错误！','warning');
			            }else{  
			                $.messager.alert('信息提示','修改密码失败！','error');  
			           } 
			     }  
		});  
	}
	
	function closeMm(){  
		mm.window('close');  
	} 
	
	</script>
</head>
<body class="easyui-layout">
	<div id="north" region="north" title="&nbsp;" split="true" style="height: 100px; padding: 10px 3px 0px 5px;"> 
		<img src="/images/logo2_1.gif" height="50px" style="float: left"/>
		<a class="easyui-linkbutton" iconCls="icon-undo" style="float: right; margin-top:32px; margin-bottom:0;" onclick="tc()">退出系统</a>
		<a class="easyui-linkbutton" iconCls="icon-edit" style="float: right; margin-top:32px; margin-bottom:0; margin-right:8px" onclick="openMm()">修改密码</a>		
	</div>

	<!-- <div id="south" region="south" title="&nbsp;" split="true"
		style="height: 30px; padding: 10px; background: #efefef;">
	</div> -->

	<div id="west" region="west" split="true" iconCls="icon-back"
		title="系统菜单" style="width: 200px; padding1: 1px; overflow: hidden;">
		<div class="easyui-accordion" fit="true" border="false">
		<c:forEach items="${list }" var="m">
			<div title="${m.mc }" class="menu0">
			<c:forEach items="${m.second }" var="s">
				<div><a onclick="addTab('${s.text}','${s.url }?en=${s.enable }')"> <img
					src="/js/themes/default/images/tree_file.gif" /> <span>${s.text}</span>
				</a></div>
			</c:forEach>
			</div>
		</c:forEach>
		
		
			<!--<div title="系统维护" class="menu0">
				<div><a onclick="addTab('常量管理','/itmanager/cl')"> <img
					src="/js/themes/default/images/tree_file.gif" /> <span>常量管理</span>
				</a></div>
				<div><a onclick="addTab('角色维护','/itmanager/yh/jswh')"> <img
					src="/js/themes/default/images/tree_file.gif" /> <span>角色维护</span>
				</a></div>
				<div><a onclick="addTab('菜单维护','/itmanager/yh/qxwh')"> <img
					src="/js/themes/default/images/tree_file.gif" /> <span>菜单维护</span>
				</a></div>
				<div><a onclick="addTab('角色权限','/itmanager/yh/jsqx')"> <img
					src="/js/themes/default/images/tree_file.gif" /> <span>角色权限</span>
				</a></div>
				<div><a onclick="addTab('菜单功能','/itmanager/yh/gnwh')"> <img
					src="/js/themes/default/images/tree_file.gif" /> <span>菜单功能</span>
				</a></div>
				
				<div><a onclick="addTab('用户维护','/itmanager/yh/yhwh')"> <img
					src="/js/themes/default/images/tree_file.gif" /> <span>用户维护</span>
				</a></div>
				
			</div>
			<div title="IT管理" selected="true" class="menu0">
				<div><a onclick="addTab('员工管理','/itmanager/yg')"> <img
					src="/js/themes/default/images/tree_file.gif" /> <span>员工管理</span>
				</a></div>
				<div><a onclick="addTab('设备分类','/itmanager/sbfl')"> <img
					src="/js/themes/default/images/tree_file.gif" /> <span>设备分类</span>
				</a></div>
				 <a onclick="addTab('设备分类公有属性','/itmanager/sbflgysx')"> <img
					src="/js/themes/default/images/tree_file.gif" /> <span>设备分类公有属性</span>
				</a> 
				<div><a onclick="addTab('设备分类特有属性','/itmanager/sbfltysx')"> <img
					src="/js/themes/default/images/tree_file.gif" /> <span>设备分类特有属性</span>
				</a></div>
				<div><a onclick="addTab('设备管理','/itmanager/sb')"> <img
					src="/js/themes/default/images/tree_file.gif" /> <span>设备管理</span>
				</a></div>
				<div><a onclick="addTab('员工设备管理','/itmanager/ygsb')"> <img
					src="/js/themes/default/images/tree_file.gif" /> <span>员工设备管理</span>
				</a></div>
				<div><a onclick="addTab('文件管理','/itmanager/file')"> <img
					src="/js/themes/default/images/tree_file.gif" /> <span>文件管理</span>
				</a></div>
			</div>
			<div title="库存管理" class="menu0">
				<div><a onclick="addTab('库存统计','/itmanager/kctj')"> <img
					src="/js/themes/default/images/tree_file.gif" /> <span>库存统计</span>
				</a></div>
				<div><a onclick="addTab('使用记录','/itmanager/kcjl')"> <img
					src="/js/themes/default/images/tree_file.gif" /> <span>使用记录</span>
				</a></div>
			</div>-->
			
			
			
			
		</div>
	</div>

	<div id="center" region="center" title="&nbsp;">
		<div class="easyui-tabs" fit="true" border="false" id="tt">
			<div title="欢迎页面" iconCls="icon-redo" style="padding: 20px; overflow: hidden;">
				<div style="margin-top: 20px;">
					<font color="#424242"><h3>连杭科技欢迎您！</h3>
					<li>欢迎您使用IT管理功能</li>
					</font>
				</div>
			</div>
		</div>
	</div>
	
		<div id="mm-window" title="修改密码" style="width:350px;height:200px;">
				<div style="text-align: center;padding-top: 10px;">
					<form method="post" action="/itmanager/yh/mm">
						<table>
							<tr>
								<td>旧密码：</td>
								<td><input name="jmm" id="jmm" type="password"></input></td>
							</tr>
							<tr>
								<td>新密码：</td>
								<td><input name="mm" id="mm" type="password"></input></td>
							</tr>
							<tr>
								<td>确认密码：</td>
								<td><input name="qrmm" id="qrmm" type="password" class="easyui-validatebox" required="true" validType="equalTo('#mm')"></input></td>
							</tr>
						</table>
					</form>
				</div>
				<div style="text-align:center;">
					<a href="javascript:void(0)" onclick="editMm()" id="mm-save" icon="icon-ok">修改</a>
					<a href="javascript:void(0)" onclick="closeMm()" id="mm-cancel" icon="icon-cancel">取消</a>
				</div>
		</div>
	

</body>
</html>
